//
//  UploadProductCell.m
//  UEAssistant
//
//  Created by mac on 2017/6/22.
//  Copyright © 2017年 youyixinxi. All rights reserved.
//

#import "UploadProductCell.h"

@interface UploadProductCell ()

@property (nonatomic, strong) UIView                                              *backView;
@property (nonatomic, strong) UILabel                                             *nameLabel;
@property (nonatomic, strong) UILabel                                             *langugeType;
@property (nonatomic, strong) UILabel                                             *timeLabel;
@property (nonatomic, strong) UIImageView                                         *yuImage;
@property (nonatomic, strong) UIImageView                                         *timeImage;
@property (nonatomic, strong) UIImageView                                         *seletImage;

@end

@implementation UploadProductCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setUI];
    }
    return self;
}

- (void)setUI{
    
    self.backgroundColor = RGB(250, 250, 250, 1);
    
    _backView = [[UIView alloc]initWithFrame:CGRectMake(10*Radio, 6*Radio, Screen_Width-20*Radio, 120*Radio-12*Radio)];
    _backView.backgroundColor = [UIColor whiteColor];
    _backView.layer.cornerRadius = 3*Radio;
    _backView.layer.shadowColor = [UIColor blackColor].CGColor;
    _backView.layer.shadowOffset = CGSizeMake(0, 0);
    _backView.layer.shadowOpacity = 0.3;
    _backView.layer.shadowRadius = 1.0;
    _backView.layer.shouldRasterize = YES; //圆角缓存
    _backView.layer.rasterizationScale = [UIScreen mainScreen].scale;//提高流畅度
    [self addSubview:_backView];
    
    _nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(58*Radio,8*Radio, 230*Radio, 30*Radio)];
    _nameLabel.backgroundColor = [UIColor colorWithWhite:1 alpha:0];
    _nameLabel.textColor = RGB(51, 51, 51, 1);
    _nameLabel.textAlignment = NSTextAlignmentLeft;
    _nameLabel.font = [UIFont systemFontOfSize:FLEXIBLE(18)];
    [_backView addSubview:_nameLabel];
    
    _timeImage = [[UIImageView alloc]initWithFrame:CGRectMake(58*Radio, _nameLabel.frame.origin.y+_nameLabel.frame.size.height+5*Radio, 20*Radio, 20*Radio)];
    _timeImage.image = [UIImage imageNamed:@"time"];
    [_backView addSubview:_timeImage];
    
    _timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(_timeImage.frame.origin.x+_timeImage.frame.size.width+10*Radio, _timeImage.frame.origin.y-5*Radio, 200*Radio, 30*Radio)];
    _timeLabel.backgroundColor = [UIColor colorWithWhite:1 alpha:0];
    _timeLabel.textColor = RGB(124, 132, 148, 1);
    _timeLabel.textAlignment = NSTextAlignmentLeft;
    _timeLabel.font = [UIFont systemFontOfSize:FLEXIBLE(16)];
    [_backView addSubview:_timeLabel];
    
    _yuImage = [[UIImageView alloc]initWithFrame:CGRectMake(_timeImage.frame.origin.x, _timeImage.frame.origin.y+_timeImage.frame.size.height+10*Radio, 20*Radio, 20*Radio)];
    _yuImage.image = [UIImage imageNamed:@"language"];
    [_backView addSubview:_yuImage];
    
    _langugeType = [[UILabel alloc]initWithFrame:CGRectMake(_yuImage.frame.origin.x+_yuImage.frame.size.width+10, _yuImage.frame.origin.y-5*Radio, 220*Radio, 30*Radio)];
    _langugeType.backgroundColor = [UIColor whiteColor];
    _langugeType.textColor = RGB(124, 132, 148, 1);
    _langugeType.textAlignment = NSTextAlignmentLeft;
    _langugeType.font = [UIFont systemFontOfSize:FLEXIBLE(16)];
    [_backView addSubview:_langugeType];
    
    [_backView addSubview:self.seletImage];
    
}

- (UIImageView *)seletImage{
    
    if (!_seletImage) {
        _seletImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 20*Radio, 20*Radio)];
        _seletImage.backgroundColor = [UIColor clearColor];
        _seletImage.center = CGPointMake(22*Radio, 90*Radio/2);
    }
    return _seletImage;
}

@end
